{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport raf from \"rc-util/es/raf\";\nimport * as React from 'react';\nimport { useRef } from 'react';\nexport default function useFrameState(defaultValue) {\n  var _React$useState = React.useState(defaultValue),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    value = _React$useState2[0],\n    setValue = _React$useState2[1];\n  var frameRef = useRef(null);\n  var batchRef = useRef([]);\n  var destroyRef = useRef(false);\n  React.useEffect(function () {\n    destroyRef.current = false;\n    return function () {\n      destroyRef.current = true;\n      raf.cancel(frameRef.current);\n      frameRef.current = null;\n    };\n  }, []);\n  function setFrameValue(updater) {\n    if (destroyRef.current) {\n      return;\n    }\n    if (frameRef.current === null) {\n      batchRef.current = [];\n      frameRef.current = raf(function () {\n        frameRef.current = null;\n        setValue(function (prevValue) {\n          var current = prevValue;\n          batchRef.current.forEach(function (func) {\n            current = func(current);\n          });\n          return current;\n        });\n      });\n    }\n    batchRef.current.push(updater);\n  }\n  return [value, setFrameValue];\n}","map":{"version":3,"names":["raf","React","useRef","useFrameState","defaultValue","useState","value","setValue","frameRef","batchRef","destroyRef","useEffect","current","cancel","setFrameValue","updater","prevValue","forEach","func","push"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/form/hooks/useFrameState.js"],"sourcesContent":["import raf from \"rc-util/es/raf\";\nimport * as React from 'react';\nimport { useRef } from 'react';\nexport default function useFrameState(defaultValue) {\n  const [value, setValue] = React.useState(defaultValue);\n  const frameRef = useRef(null);\n  const batchRef = useRef([]);\n  const destroyRef = useRef(false);\n  React.useEffect(() => {\n    destroyRef.current = false;\n    return () => {\n      destroyRef.current = true;\n      raf.cancel(frameRef.current);\n      frameRef.current = null;\n    };\n  }, []);\n  function setFrameValue(updater) {\n    if (destroyRef.current) {\n      return;\n    }\n    if (frameRef.current === null) {\n      batchRef.current = [];\n      frameRef.current = raf(() => {\n        frameRef.current = null;\n        setValue(prevValue => {\n          let current = prevValue;\n          batchRef.current.forEach(func => {\n            current = func(current);\n          });\n          return current;\n        });\n      });\n    }\n    batchRef.current.push(updater);\n  }\n  return [value, setFrameValue];\n}"],"mappings":";AAAA,OAAOA,GAAG,MAAM,gBAAgB;AAChC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,MAAM,QAAQ,OAAO;AAC9B,eAAe,SAASC,aAAa,CAACC,YAAY,EAAE;EAClD,sBAA0BH,KAAK,CAACI,QAAQ,CAACD,YAAY,CAAC;IAAA;IAA/CE,KAAK;IAAEC,QAAQ;EACtB,IAAMC,QAAQ,GAAGN,MAAM,CAAC,IAAI,CAAC;EAC7B,IAAMO,QAAQ,GAAGP,MAAM,CAAC,EAAE,CAAC;EAC3B,IAAMQ,UAAU,GAAGR,MAAM,CAAC,KAAK,CAAC;EAChCD,KAAK,CAACU,SAAS,CAAC,YAAM;IACpBD,UAAU,CAACE,OAAO,GAAG,KAAK;IAC1B,OAAO,YAAM;MACXF,UAAU,CAACE,OAAO,GAAG,IAAI;MACzBZ,GAAG,CAACa,MAAM,CAACL,QAAQ,CAACI,OAAO,CAAC;MAC5BJ,QAAQ,CAACI,OAAO,GAAG,IAAI;IACzB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EACN,SAASE,aAAa,CAACC,OAAO,EAAE;IAC9B,IAAIL,UAAU,CAACE,OAAO,EAAE;MACtB;IACF;IACA,IAAIJ,QAAQ,CAACI,OAAO,KAAK,IAAI,EAAE;MAC7BH,QAAQ,CAACG,OAAO,GAAG,EAAE;MACrBJ,QAAQ,CAACI,OAAO,GAAGZ,GAAG,CAAC,YAAM;QAC3BQ,QAAQ,CAACI,OAAO,GAAG,IAAI;QACvBL,QAAQ,CAAC,UAAAS,SAAS,EAAI;UACpB,IAAIJ,OAAO,GAAGI,SAAS;UACvBP,QAAQ,CAACG,OAAO,CAACK,OAAO,CAAC,UAAAC,IAAI,EAAI;YAC/BN,OAAO,GAAGM,IAAI,CAACN,OAAO,CAAC;UACzB,CAAC,CAAC;UACF,OAAOA,OAAO;QAChB,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IACAH,QAAQ,CAACG,OAAO,CAACO,IAAI,CAACJ,OAAO,CAAC;EAChC;EACA,OAAO,CAACT,KAAK,EAAEQ,aAAa,CAAC;AAC/B"},"metadata":{},"sourceType":"module"}